GXCopyToStyle
You can use theGXCopyToStyle
function to create a copy of an existing style object.
gxStyle GXCopyToStyle(gxStyle target, gxStyle source);
target
- A reference to the style object to copy the source style object's contents into. If you specify
nil
for this parameter, this function creates a new style object.source
- A reference to the style object whose contents you want to copy.
- function result
- A reference to the copy (that is, the target style).
DESCRIPTION
TheGXCopyToStyle
function copies the contents of an existing style object to another, or it creates a new style object and copies the contents of an existing style object into it. The function copies the stylistic and typographic properties and the tag list (but not the owner count) of the style object specified by thesource
parameter into the style object specified by thetarget
parameter. It clones, but does not copy, the tag objects in the tag list.If you specify
nil
for thetarget
parameter, theGXCopyToStyle
function creates a new style object and copies the source properties, including tag list, into it. The function gives the new style object an owner count of 1.You can use the
GXCopyToStyle
function to create a copy of a style object in order to modify it without changing the original.SPECIAL CONSIDERATIONS
If you specifynil
for thetarget
parameter and no error occurs, theGXCopyToStyle
function creates a style object; you are responsible for disposing of that object when you no longer need it.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory style_is_nil SEE ALSO
To create a new style that is a copy of the default style instead of a copy of an existing style, use theGXNewStyle
function, described on page 3-17.To compare two style objects, use the
GXEqualStyle
function, described in the next section.